<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>这里是详情页</h1>
    <div class="container-detail">

    </div>
</body>

</html>
<script src="./utils/qr.js"></script>
<script>
    //获取浏览器里面的query参数
    // console.log(location.href)
    (function () {
        let containerDetail = document.querySelector(".container-detail")
        let url = location.href;

        let { productid } = getUrlParams(url);

        // console.log(param)

        //发请求
        fetch(`http://chst.vip:1234/api/getmoneyctrlproduct?productid=${productid}`)
            .then(body => body.json())
            .then(res => {
                // console.log(res)
                let result = res.result[0]
                let html =
                    `
                ${result.productImg2}
                <h3>
                    ${result.productInfo}
                </h3>
            `

                containerDetail.innerHTML = html;
            })
    })()
</script>